<template>
  <div>

    <el-main>
    <!-- This is 我的考试 page！ -->

      <!-- 面包屑 -->
      <div class="bg-breadcrumb" style="margin-bottom: 15px;">
        <el-breadcrumb separator-class="el-icon-arrow-right">
          <el-breadcrumb-item :to="{ path: '/student/studenthomepage' }">首页</el-breadcrumb-item>
          <el-breadcrumb-item>我的考试</el-breadcrumb-item>
        </el-breadcrumb>
      </div>

      <!-- 展示学生考试安排的列表 -->
      <el-card shadow="always" :body-style="{ padding: '20px' }">
        <!-- card body -->
        <el-table
          :data="examList"
          :header-cell-style="{fontSize: '18px'}"
          :cell-style="{fontSize: '18px'}"
          stripe>
          <el-table-column
            label="考试科目"
            prop="course_name"
            align="center"
            width="">
          </el-table-column>
          <el-table-column
            label="考试教室"
            prop="exam_classroom"
            align="center"
            width="">
          </el-table-column>
          <el-table-column
            label="考试日期"
            prop="exam_day"
            align="center"
            width="">
          </el-table-column>
          <el-table-column
            label="考试时间"
            prop="exam_time"
            align="center"
            width="">
          </el-table-column>
        </el-table>
      </el-card>

    </el-main>


  </div>
</template>

<script>
export default {
  data () {
    return {
      examList: [],
      currentPage: 0,
    }
  },
  created () {
    this.getExamList()
  },
  methods: {
    // 获取所有考试信息
    async getExamList () {
      const { data: res } = await this.$http.post(`exam/getSelfExam?page=${this.currentPage}&rows=10`)
      console.log(res)
      if (!res.state) return this.$message.error(res.msg)
      this.examList = res.detail
    }
  }
}
</script>

<style lang="less" scoped>

</style>
